import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/Home",
    name: "home",
    component: () => import("../views/Home.vue"),

    children: [
      {
        path: "/driverOrder",
        component: () => import("../views/order/DriverOrder.vue"),
      },
      {
        path: "/home",
        redirect: "/DriverOrder",
      },
      {
        path: "/inputOrder",
        component: () => import("../views/order/InputOrder.vue"),
      },
      {
        path: "/orderList",
        component: () => import("../views/order/orderList.vue"),
      },
      {
        path: "/bizList",
        component: () => import("../views/biz/bizList.vue"),
      },
      {
        path: "/bizVerify",
        component: () => import("../views/biz/bizVerify.vue"),
      },
    ],
  },
  {
    path: "/Login",
    name: "login",
    component: () => import("../views/Login.vue"),
  },
  {
    path: "/",
    redirect: "Login",
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
